#ifndef __msg_loop_h__
#define __msg_loop_h__

#include "windefine.h"
#include "../base/locker.h"
#include "../base/msg_pump.h"

#define WM_UI_MESSAGE   (WM_USER + 2014)
#define WM_UI_QUIT      (WM_USER + 2015)
class MessageLoopUI : public MessagePump
{
public:
    MessageLoopUI();
    ~MessageLoopUI();

public:
    virtual DWORD Run();

    virtual BOOL Pause();

    virtual BOOL Continue();

    virtual DWORD Quit( DWORD dwTimeout, DWORD dwRetCode );

    virtual BOOL PostQueueTask( ITaskDelegate * pTaskDelegate, DWORD nTask, ITaskHandler * pTaskHandler );

    virtual BOOL IsCurrentThread( DWORD dwThreadId );

    virtual BOOL IsRunning();

private:
    Locker  m_Locker;
    DWORD   m_dwThreadId;
};

#endif